
#################### 基础配置 ####################
set-option -sg escape-time 10
set-option -g default-terminal "screen-256color"

set -g mode-keys vi

bind C-c run " tmux save-buffer - | xclip -i -sel clipboard"
bind C-v run " tmux set-buffer \"$(xclip -o -sel clipboard)\"; tmux paste-buffer"

bind-key -T copy-mode-vi 'v' send -X begin-selection
bind-key -T copy-mode-vi 'y' send -X copy-selection-and-cancel
bind-key -T copy-mode-vi Escape send -X cancel

set -g base-index 1 # 设置窗口的起始下标为1
setw -g pane-base-index 1 # 设置面板的起始下标为1
set -g allow-rename off # 设置窗口不允许自动改名
set -g history-limit 10000

#################### 按键映射 ####################
unbind C-b
set -g prefix C-n
bind-key C-n send-prefix

unbind %
bind \\ split-window -h
unbind '"'
bind - split-window -v

unbind r
bind r source ~/.tmux.conf

bind -r j resize-pane -D 5
bind -r k resize-pane -U 5
bind -r h resize-pane -L 5
bind -r l resize-pane -R 5


#################### 插件管理 ####################
set -g @plugin 'tmux-plugins/tpm'

set -g @plugin 'christoomey/vim-tmux-navigator'
set -g @plugin 'jimeh/tmux-themepack'

set -g @themepack 'powerline/double/cyan'

#################### 加载插件 ####################
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'
